home *** CD-ROM | disk | FTP | other *** search
/ New Perspectives on Computer Concepts / New Perspectives on Computer Concepts.iso / np2010c / page788.pag < prev    next >
Portable Network Graphic  |  2008-10-02  |  72KB  |  817x1045  |  8-bit (256 colors)
Labels: chat room | crt screen | hakham | laptop | monitor | sky
OCR: 720 SECTION D CHAPTER 1.2 Does the order of rules affect the way a Prolog program runs? When coding programs in a procedural language, such as Pascal or BASIC the order of program instructions is critically important. For exam- ple if you place input statements for pizza size and price after the code that calculates the price per square inch, the program produces an error because it has no numbers to use for the calculation. In contrast, the order or sequence of rules Prolog program usually not critical. What does the complete pizza program look like in Prolog? The complete pizza program includes the facts that describe two pizzas and rules that describe the better deal, square-inch price and area Figure 12-50 contains the Prolog code for the entire pizza program FIGURE 12-50 The Complete ...